package com.zhibang.report.controller;

import com.sannuo.common.domain.Monthly;
import com.sannuo.common.result.Result;
import com.sannuo.common.result.ResultCode;
import com.zhibang.report.service.MonthlyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/Monthly")
public class MonthlyController {
    @Autowired
    private MonthlyService monthlyService;

    @RequestMapping(value = "ydsj",method = RequestMethod.GET)
    public Result ydsj(){
        List<Monthly> monthlies = monthlyService.selectMonthly();
        for (Monthly monthly : monthlies) {
            System.out.println(monthly);
        }
        return Result.ok(ResultCode.SUCCESS,monthlies);
    }
}
